package com.lau.xml;

import java.util.HashMap;
import java.util.Iterator;
import java.util.Map;

/**
 * Created by liutf on 2016/5/30.
 */
public class Person {
    private int id;
    private String category;
    private String try1;
    private String name;
    private String gender;
    private Map<String, String> emails = new HashMap();

    public void setGender(String gender) {
        this.gender = gender;
    }

    public void setId(int id) {
        this.id = id;
    }

    public void setCategory(String category) {
        this.category = category;
    }

    public void setTry1(String try1) {
        this.try1 = try1;
    }

    public void setName(String name) {
        this.name = name;
    }

    public void add(String key, String value) {
        this.emails.put(key, value);
    }

    public void print() {
        System.out.println("id==" + id + " category=" + category + " try1=" + try1
                +" name=" + name + " gender=" + gender);
        for(Iterator i = emails.keySet().iterator(); i.hasNext(); ) {
            String type = (String) i.next();
            String address = (String) emails.get(type);
            System.out.println("  email (type " + type + ") : " + address);
        }
    }

}
